//
//  CommondHandle.h
//  RentTable
//
//  Created by mac on 2024/11/29.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface CommondHandle : NSObject

/// 给对应视图添加渐变色
/// @param gView 想要渐变色的视图
/// @param bounds 渐变色区域
/// @param colors 渐变色组
/// @param startPoint 渐变开始点，如(1, 0.5)
/// @param endPoint 渐变结束点，如(0, 0.5)
/// @param cornerRadius 圆角，不用输入0
/// @param should 是否需要放置在最下层图层
+ (CAGradientLayer *)gradientTheView:(UIView *)gView bounds:(CGRect)bounds colors:(NSArray <UIColor *> *)colors startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint hasCornerRadius:(CGFloat)cornerRadius shouldTakeBack:(BOOL)should;

+ (CGFloat)getHeightLineWithString:(NSString *)string withWidth:(CGFloat)width withFont:(UIFont *)font minLineHeight:(CGFloat)minLineHeight;

/// 部分圆角
+ (void)cornerTheView:(UIView *)theView byCorner:(UIRectCorner)corner withRadias:(CGFloat)radias;
+ (BOOL)getLanguageRTL;

/// 普通字符串转自定义行高字符串富文本
+ (NSAttributedString *)changeStrToCustomLineHeightAttributedStr:(NSString *)str lineHeight:(NSInteger)lineHegiht;
@end

NS_ASSUME_NONNULL_END
